<?php
/**
 * Example_View class
 */
class Example_View extends Psa_Plugin_View{
	
	/**
	 * Shows form
	 */
	function sum(){
		
		$this->psa_smarty->assign('page_title_text', 'Sum numbers');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch("page_title.tpl"));		
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch("sum_form.tpl"));
	}

	
	/**
	 * Shows form
	 */
	function sum_ajax(){
		
		$this->psa_smarty->assign('ajax_form', 1);
		$this->psa_smarty->assign('page_title_text', 'Sum numbers with ajax');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('sum_form.tpl'));
	}
	
	
	/**
	 * Shows result with ajax
	 */
	function sum_result_ajax(){
		
		$this->psa_smarty->assign('content', $this->psa_result->sum_result);
	}
}
